/*
 * Albareth - an action roleplaying game.
 * Copyright (C) 2008 Jens Anuth
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 *   02110-1301, USA.
 * 
 * $Id: Ground.java 35 2008-05-05 14:16:37Z jens464 $
*/
package albareth.core.entity;

import albareth.frontend.Tile;
import albareth.frontend.TileCollection;


public class Ground
{
    public static final Ground NONE = new Ground(TileCollection.BLACK, GroundType.NONE);
    public static final Ground FLOOR_DARK1 = new Ground(TileCollection.FLOOR_DARK1, GroundType.FLOOR);
    public static final Ground FLOOR_DARK2 = new Ground(TileCollection.FLOOR_DARK2, GroundType.FLOOR);
    public static final Ground FLOOR_DARK3 = new Ground(TileCollection.FLOOR_DARK3, GroundType.FLOOR);
    public static final Ground FLOOR_LIGHT1 = new Ground(TileCollection.FLOOR_LIGHT1, GroundType.FLOOR);
    public static final Ground FLOOR_LIGHT2 = new Ground(TileCollection.FLOOR_LIGHT2, GroundType.FLOOR);
    public static final Ground FLOOR_LIGHT3 = new Ground(TileCollection.FLOOR_LIGHT3, GroundType.FLOOR);
    public static final Ground WALL1 = new Ground(TileCollection.WALL1, GroundType.WALL);
    public static final Ground WALL2 = new Ground(TileCollection.WALL2, GroundType.WALL);
    public static final Object DUNGEON_WINDOW1 = new Ground(TileCollection.DUNGEON_WINDOW1, GroundType.WINDOW);
    public static final Object DUNGEON_WINDOW2 = new Ground(TileCollection.DUNGEON_WINDOW2, GroundType.WINDOW);

    
    public static final Ground HOUSE_WALL_1 = new Ground(TileCollection.HOUSE_WALL_1, GroundType.WALL);
    public static final Ground HOUSE_WALL_2 = new Ground(TileCollection.HOUSE_WALL_2, GroundType.WALL);
    public static final Ground HOUSE_WALL_3 = new Ground(TileCollection.HOUSE_WALL_3, GroundType.WALL);
    public static final Ground HOUSE_WINDOW_1 = new Ground(TileCollection.HOUSE_WINDOW_1, GroundType.WINDOW);
    public static final Ground HOUSE_WINDOW_2 = new Ground(TileCollection.HOUSE_WINDOW_2, GroundType.WINDOW);
    public static final Ground HOUSE_WINDOW_3 = new Ground(TileCollection.HOUSE_WINDOW_3, GroundType.WINDOW);
    public static final Ground HOUSE_FLOOR_1 = new Ground(TileCollection.HOUSE_FLOOR_1, GroundType.FLOOR);
    public static final Ground HOUSE_FLOOR_2 = new Ground(TileCollection.HOUSE_FLOOR_2, GroundType.FLOOR);
    public static final Ground HOUSE_FLOOR_3 = new Ground(TileCollection.HOUSE_FLOOR_3, GroundType.FLOOR);
    
    public static final Ground MOUNTAINS_S        = new Ground(TileCollection.MOUNTAINS_S, GroundType.MOUNTAIN);
    public static final Ground MOUNTAINS_M        = new Ground(TileCollection.MOUNTAINS_M, GroundType.MOUNTAIN);
    public static final Ground MOUNTAINS_L        = new Ground(TileCollection.MOUNTAINS_L, GroundType.MOUNTAIN);
    public static final Ground MOUNTAINS_XL       = new Ground(TileCollection.MOUNTAINS_XL, GroundType.MOUNTAIN);
    public static final Ground WATER_S            = new Ground(TileCollection.WATER_S, GroundType.WATER);
    public static final Ground WATER_M            = new Ground(TileCollection.WATER_M, GroundType.WATER);
    public static final Ground WATER_L            = new Ground(TileCollection.WATER_L, GroundType.WATER);
    public static final Ground FOREST_S           = new Ground(TileCollection.FOREST_S, GroundType.FOREST);
    public static final Ground FOREST_M           = new Ground(TileCollection.FOREST_M, GroundType.FOREST);
    public static final Ground FOREST_L           = new Ground(TileCollection.FOREST_L, GroundType.FOREST);
    public static final Ground DIRT_1             = new Ground(TileCollection.DIRT_1, GroundType.LEA);
    public static final Ground DIRT_2             = new Ground(TileCollection.DIRT_2, GroundType.LEA);
    public static final Ground DIRT_3             = new Ground(TileCollection.DIRT_3, GroundType.LEA);
    public static final Ground GRASS_1            = new Ground(TileCollection.GRASS_1, GroundType.LEA);
    public static final Ground GRASS_2            = new Ground(TileCollection.GRASS_2, GroundType.LEA);
    public static final Ground GRASS_3            = new Ground(TileCollection.GRASS_3, GroundType.LEA);
    public static final Ground BUSHES_S           = new Ground(TileCollection.BUSHES_S, GroundType.LEA);
    public static final Ground BUSHES_M           = new Ground(TileCollection.BUSHES_M, GroundType.LEA);
    public static final Ground BUSHES_L           = new Ground(TileCollection.BUSHES_L, GroundType.LEA);

    
    public static final Ground DIRT_LIGHT_1       = new Ground(TileCollection.DIRT_LIGHT_1, GroundType.FLOOR);
    public static final Ground DIRT_LIGHT_2       = new Ground(TileCollection.DIRT_LIGHT_2, GroundType.FLOOR);
    public static final Ground DIRT_LIGHT_3       = new Ground(TileCollection.DIRT_LIGHT_3, GroundType.FLOOR);
    public static final Ground DIRT_GRASS_1       = new Ground(TileCollection.DIRT_GRASS_1, GroundType.FLOOR);
    public static final Ground DIRT_GRASS_2       = new Ground(TileCollection.DIRT_GRASS_2, GroundType.FLOOR);
    public static final Ground DIRT_MUD_1         = new Ground(TileCollection.DIRT_MUD_1, GroundType.FLOOR);
    public static final Ground DIRT_MUD_2         = new Ground(TileCollection.DIRT_MUD_2, GroundType.FLOOR);


    private Tile _tile;
    private GroundType _type;
    
    private Ground(Tile tile, GroundType type)
    {
        _tile = tile;
        _type = type;
    }
    
    public Tile getTile()
    {
        return _tile;
    }
    
    public int getWalkCost()
    {
        return _type.getWalkCost();
    }
    
    public boolean isWalkable()
    {
        return _type.isWalkable();
    }

    public int getViewCost()
    {
        return _type.getViewCost();
    }

    public boolean isViewable()
    {
        return _type.isTranslucent();
    }

    public GroundType getType()
    {
        return _type;
    }
}
